package com.somlsis.activity

import android.content.Intent
import android.net.Uri
import android.provider.Settings
import android.view.LayoutInflater
import com.base.BaseActivity
import com.somlsis.R
import com.somlsis.databinding.ActivityAccountManagementBinding
import com.somlsis.databinding.ActivityAuthorityManagementBinding

/**
 * 权限管理
 */
class AuthorityManagementActivity : BaseActivity<ActivityAuthorityManagementBinding>() {
    override fun getViewBinding(): ActivityAuthorityManagementBinding {
        return ActivityAuthorityManagementBinding.inflate(LayoutInflater.from(this))
    }


    override fun createView() {
        binding.layoutTitle.title.text = getString(R.string.authority_management)
        binding.layoutTitle.back.setOnClickListener {
            finish()
        }
        binding.toSystemSettings.setOnClickListener {
            //跳转应用消息，间接打开应用权限设置-效率高
            //跳转应用消息，间接打开应用权限设置-效率高
            val intent = Intent()
            intent.action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS
            val uri = Uri.fromParts("package", context?.let { it.packageName }, null)
            intent.data = uri
            startActivity(intent)
        }
    }
}